Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helper attribute macros for writing free function parsers/writers #171

Merged
merged 1 commit into from
Nov 26, 2022

Conversation

csnover
Copy link
Collaborator

@csnover csnover commented Nov 16, 2022

Issues [that I remember]:

  1. It uses names parser and writer for the attributes. I don’t know if reader and writer would be better? parser and serializer? Can we please bikeshed this until the end times?!
  2. The syntax for taking all the args into a single object abuses the C variadic signature syntax, and this kind of sucks (I would rather prefer it to be a spread-like syntax ...args: Ty), but maybe this sucks less than writing a custom version of syn::ItemFn? I will do the custom one if someone makes me, but I was feeling lazy every day and it was a very convenient already-existing syntax that I could abuse.
  3. It sure is tempting to replace all of the custom trait impls’ fn read_options and fn write_options with this to create a single source of truth for what R is, since trait aliases still aren’t a thing. Should this be considered idiomatic ever?

Copy link
Owner

@jam1garner jam1garner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this, ty ty

@jam1garner jam1garner merged commit cf19a68 into jam1garner:master Nov 26, 2022
@csnover csnover deleted the please-send-helpers branch July 5, 2024 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants